import { createStore } from 'vuex'

export default createStore({
  state: {
    tagsList: []    //存放所有tag标签的数组
  },
  getters: {
  },
  mutations: {
    // 删除一个tag
    delTagsItem(state, data) {
      state.tagsList.splice(data.index, 1)
    },
    //添加一个tag
    setTagsItem(state, data) {
      state.tagsList.push(data);
    },
    // 清除其他tag
    clearTagsOther(state, data) {
      state.tagsList = data;
    },
    // 清除所有tag
    clearTags(state) {
      state.tagsList = []
    }
  },
  actions: {
  },
  modules: {
  }
})
